#pragma once

#include "spk_def.h"
#include <string>

#ifndef _WIN32

typedef unsigned int        DWORD;
typedef int                 BOOL;
typedef unsigned char       BYTE;
typedef unsigned short      WORD;
typedef unsigned int        LONG;

#pragma pack(1)

typedef struct tagBITMAPFILEHEADER {
	WORD           bfType;
	DWORD          bfSize;
	WORD           bfReserved1;
	WORD           bfReserved2;
	DWORD          bfOffBits;
} BITMAPFILEHEADER;

typedef struct tagBITMAPINFOHEADER {
	DWORD          biSize;
	LONG           biWidth;
	LONG           biHeight;
	WORD           biPlanes;
	WORD           biBitCount;
	DWORD          biCompression;
	DWORD          biSizeImage;
	LONG           biXPelsPerMeter;
	LONG           biYPelsPerMeter;
	DWORD          biClrUsed;
	DWORD          biClrImportant;
} BITMAPINFOHEADER;


typedef struct tagRGBQUAD {
	BYTE    rgbBlue; 
	BYTE    rgbGreen; 
	BYTE    rgbRed; 
	BYTE    rgbReserved;
} RGBQUAD;

#pragma pop()

#endif 

typedef struct tagMat {
	int cols;
	int rows;
	u8 *data;
	int channels;
} _Mat;



class spk_bmp
{
  public:
	  _Mat read(std::string path);
	  int  write(std::string path,_Mat img);
};
